package jUnitTest;

import static org.junit.Assert.*;

import java.util.ArrayList;

import org.junit.Before;
import org.junit.Test;

import businessLogic.PurchaseBLService;
import businessLogic.Purchase_Stub;

public class PurchaseBLServiceTest {
	
	private PurchaseBLService purchase;

	@Before
	public void setUp() throws Exception {
		purchase = new Purchase_Stub(null, null, 0);
	}

	@Test
	public void testLogin() {
		boolean result = purchase.login("admin", "admin");
		assertEquals(true, result);
	}

	@Test
	public void testGetBookByISBN() {
		assertNull(purchase.getBookByISBN(null));
	}

	@Test
	public void testGetMemberByID() {
		assertNull(purchase.getMemberByID(0));
	}

	@Test
	public void testGetBookByPress() {
		purchase.getBookByPress(null);
	}

	@Test
	public void testAddPurchaseItem() {
		purchase.addPurchaseItem(null);
	}

	@Test
	public void testDeletePurchaseItem() {
		purchase.deletePurchaseItem(null);
	}

	@Test
	public void testCollectBook() {
		purchase.cancelPurchase();
	}

	@Test
	public void testGetTotal() {
		double result = purchase.getTotal(0, 0, 0);
		assertEquals(0, result, 0);
	}

	@Test
	public void testCancelPurchase() {
		purchase.cancelPurchase();
	}

	@Test
	public void testEndPurchase() {
		purchase.endPurchase();
	}

}
